Ruby program to demonstrate the bitwise XOR (^) operator

bookmark

num1=5
num2=3
res =0

res = num1 ^ num2;
print num1," ^ ", num2," = ",res,"\n"

 


Output:

5 ^ 3 = 6